package com.bm.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderModification {
    private String orderId;
    private List<Item> addedItems;
    private List<Item> removedItems;
    private Map<String, Integer> updatedItems;
    private double originalTotalPrice;
    private double newTotalPrice;
    private double discountChange;
    private LocalDateTime modificationTime;

    public OrderModification(String orderId) {
        this.orderId = orderId;
        this.addedItems = new ArrayList<>();
        this.removedItems = new ArrayList<>();
        this.updatedItems = new HashMap<>();
    }

    @Override
    public String toString() {
        return "OrderModification{" +
                "orderId='" + orderId + '\'' +
                ", addedItems=" + addedItems +
                ", removedItems=" + removedItems +
                ", updatedItems=" + updatedItems +
                ", originalTotalPrice=" + originalTotalPrice +
                ", newTotalPrice=" + newTotalPrice +
                ", discountChange=" + discountChange +
                ", modificationTime=" + modificationTime +
                '}';
    }
}
